import { Route, Link } from 'react-router-dom';
import {Information} from "../../component/User/Information";
import {Sign} from '../../component/User/Sign';
import {UploadPicture} from '../../component/User/UploadPicture';
import { Home } from "../../component/User/Home";
import { Menu } from "antd";
import {
    SearchOutlined,
    FileOutlined,
    UserOutlined,
} from '@ant-design/icons';
const user = [
    {
        path: '/UserPage/Home',
        component: Home,
        title: '首页',
        icon:<UserOutlined/>
    },
    {
        path: '/UserPage/Sign',
        component: Sign,
        title: '四六级报名',
        icon:<FileOutlined/>
    },
    {
        path: '/UserPage/Information',
        component: Information,
        title: '个人基本信息',
        icon:<UserOutlined/>
    },
]

const userRoutes = () => {
    return user.map(({ path, component }, i) => {
        return <Route key={i} path={path} component={component} />

    })
}

const userMenu = () => {
    return user.map(({ path, title,icon }, i) => {

        return (
            <Menu.Item key={title} icon={icon}>
                <Link key={title} to={path}>{title}</Link>
            </Menu.Item>
        )
    })
}



export { userRoutes, userMenu }